//
//  DFMobileCell.m
//  DFMessage
//
//  Created by lanou on 15/10/28.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "DFMobileCell.h"
#import "Header.pch"
#import "UIImageView+WebCache.h"
#import "DFSignlTon.h"
@implementation DFMobileCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        CGFloat lx = kScreenWidth/4;
        _imgsrcImage = [[UIImageView alloc]initWithFrame:CGRectMake(5, 8, lx, lx * 3 / 4)];
        [self.contentView addSubview:_imgsrcImage];
        
        _stitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(lx + 10, 5, lx * 3 - 16, 45)];
        _stitleLabel.font = [UIFont systemFontOfSize:15];
        _stitleLabel.numberOfLines = 0;
        [self.contentView addSubview:_stitleLabel];
        
        _sdateLabel = [[UILabel alloc]initWithFrame:CGRectMake(lx + 10, lx * 3 / 4 - 15, 130, 15)];
        _sdateLabel.font = [UIFont systemFontOfSize:11];
        
        [self.contentView addSubview:_sdateLabel];
        
        _comment_numLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - 30, lx * 3 / 4 - 15, 25, 15)];
        _comment_numLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_comment_numLabel];
        
        UIImageView *aimage = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 48, lx * 3 / 4 - 16, 15, 15)];
        aimage.image = [UIImage imageNamed:@"a"];
        [self.contentView addSubview:aimage];
        
//        UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0, 86, kScreenWidth, 2)];
//        line.backgroundColor = [UIColor lightGrayColor];
//        [self.contentView addSubview:line];
    }
    return self;
}

-(void)setConfigureModel:(DFMobileModel *)ConfigureModel{
    _ConfigureModel = ConfigureModel;
    DFSignlTon *signlTon = [DFSignlTon shareInstance];
    if (signlTon.savemode == SaveModeYes)
    {
        _imgsrcImage.image = [UIImage imageNamed:@""];
    }else
    {
        [_imgsrcImage sd_setImageWithURL:[NSURL URLWithString:ConfigureModel.imgsrc2]];
    }


    _stitleLabel.text = ConfigureModel.stitle;
    NSString *str = ConfigureModel.sdate;
    _sdateLabel.text = [str substringToIndex:10];
    _comment_numLabel.text = [NSString stringWithFormat:@"%@",ConfigureModel.comment_num];
  
    
}

@end
